import java.util.ArrayList;

public class Galaxy {
    public ArrayList<Body> bodies;

    public void increaseTime(double time) {

        for (Body bodys : bodies) {
            Vector force = new Vector(0.0, 0.0);
            for (Body body : bodies) {
                if (!bodys.name.equals(body.name)) {
                    Vector vector = bodys.forceFrom(body);
                    force = force.plus(vector);
                }
            }
            bodys.updateStatus(force, time);
        }

    }

    public void setBodies(ArrayList<Body> bodies) {
        this.bodies = bodies;
    }

    @Override
    public String toString() {
        return "Galaxy{" +
                "bodies=" + bodies +
                '}';
    }
}
